package com.ay.smartpark.sdk.common.utils;

import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author captain
 * @description
 * @date 2020/9/23
 */
public class StringUtilsSafetyBase {

    public static List<String> jsonArray2StringList(String str) {
        if(!StringUtils.isNotEmpty(str)) {
            return new ArrayList<>();
        }
        try {
            return JSONObject.parseArray(str,String.class);
        }catch (JSONException var1) {
            return new ArrayList(){{add(str);}};
        }
    }

}
